#include "process.h"
#include <unistd.h>
double speed = 1.0;
double total = 1024;
typedef void (*callback_t) (double total,double current);



void DownLoad(callback_t cb)
{
    double current = 0.0;
    while(current <= total)
    {
        cb(total,current);
        usleep(3000);
        current += speed;
    }
     printf("\ndownload %.2lfMB Done\n", current);
}

void UpLoad(callback_t cb)
{
    double current = 0.0;
    while(current <= total)
    {
        cb(total,current);
        usleep(3000);
        current += speed;
    }
     printf("\nupload %.2lfMB Done\n", current);
}
int main()
{
    DownLoad(Flushprocess);
    DownLoad(Flushprocess);
    UpLoad(Flushprocess);
    UpLoad(Flushprocess);
    return 0;
}
